<template>
	<view>
		<swiper class="swiper" circular indicator-dots autoplay interval="2000" duration="500"
			indicator-active-color="#ff792b">
			<swiper-item v-for="item in images" :key="item.t_banner_pk">
				<image :src="item.banner_img" mode="scaleToFill" class="swiper-image"></image>
			</swiper-item>
		</swiper>
		<index-plant-1 name="学院新闻"></index-plant-1>
	</view>
</template>

<script lang="ts" setup>
	import ajax from "@/util/request";
	import IndexPlant1 from "@/components/index/index-plant1.vue";
	import {
		onLoad
	} from "@dcloudio/uni-app";
	import {
		reactive
	} from "vue";



	const images = reactive([]);
	ajax("/banner/queryList", {
		"t_cat_fk": 5
	}).then((res: any) => {
		if (res.data.status > 0) {
			images.length = 0;
			images.push(...res.data.result_data);
		}
	})

	uni.setStorage({
		key: "loginUser",
		data: {
			name: "Hydra",
			mobile: "13547811112"
		}
	
	});
	
	onLoad((option) => {
		console.log("首页的onload! option = ",option);
	})
</script>

<style scoped>
	.swiper {
		height: 300rpx;
	}

	.swiper-item {
		display: block;
		height: 300rpx;
		line-height: 300rpx;
		text-align: center;
	}

	.swiper-list {
		margin-top: 40rpx;
		margin-bottom: 0;
	}

	.swiper-image {
		width: 750rpx;
		height: 300rpx;
	}

	.uni-common-mt {
		margin-top: 60rpx;
		position: relative;
	}

	.info {
		position: absolute;
		right: 20rpx;
	}

	.uni-padding-wrap {
		width: 550rpx;
		padding: 0 100rpx;
	}
</style>
